@import url('./common/header.css');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    min-height: calc(100vh - 150px);
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.page-title {
    text-align: center;
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.cart-items {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: 1rem;
}

.cart-item {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 1.2rem;
    padding: 1rem;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.cart-item:last-child {
    border-bottom: none;
}

.product-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    background: #f8f9fa;
    border: 1px solid #eee;
}

.item-details {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.item-details h3 {
    font-size: 1rem;
    color: #2c3e50;
    margin: 0;
}

.price {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e74c3c;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-control button {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    background: #f8f9fa;
    color: #2c3e50;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-control button:hover {
    background: #e9ecef;
}

.quantity-control span {
    min-width: 30px;
    text-align: center;
    font-size: 0.9rem;
}

.remove-btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid #dc3545;
    border-radius: 4px;
    background: #fff;
    color: #dc3545;
    font-size: 0.9rem;
    cursor: pointer;
}

.remove-btn:hover {
    background: #dc3545;
    color: #fff;
}

.cart-summary {
    margin-top: 2rem;
    background: #fff;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.cart-summary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4a90e2, #357abd);
}

.total {
    font-size: 1.25rem;
    color: #2c3e50;
    font-weight: 500;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.total span {
    font-size: 2rem;
    font-weight: 600;
    color: #e74c3c;
    letter-spacing: -0.5px;
}

.actions {
    display: flex;
    gap: 1.2rem;
}

.checkout-btn,
.continue-shopping-btn {
    padding: 1rem 2.5rem;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.checkout-btn {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

.checkout-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
}

.checkout-btn:hover::after {
    animation: shimmer 1.5s infinite;
}

.continue-shopping-btn {
    background: #fff;
    color: #4a90e2;
    border: 2px solid #4a90e2;
}

.continue-shopping-btn:hover {
    background: rgba(74, 144, 226, 0.05);
    color: #357abd;
    border-color: #357abd;
    transform: translateY(-2px);
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

@media (max-width: 768px) {
    .cart-summary {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
        padding: 1.5rem;
        margin: 1rem 0;
    }

    .total {
        font-size: 1.2rem;
        justify-content: center;
    }

    .total span {
        font-size: 1.8rem;
    }

    .actions {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
    }

    .checkout-btn,
    .continue-shopping-btn {
        width: 100%;
        padding: 1rem;
    }
}

.empty-cart {
    text-align: center;
    padding: 2rem 1rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.empty-cart p {
    font-size: 1rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.product {
    display: flex;
    flex-direction: column;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.product:hover {
    transform: translateY(-5px);
}

/*.product-image {*/
/*    width: 100%;*/
/*    height: 180px;*/
/*    object-fit: cover;*/
/*}*/

.product-details {
    padding: 15px;
}

.product-title {
    margin: 0;
    font-size: 1.2em;
    color: #333;
}

.product-price {
    margin: 10px 0;
    color: #e44d26;
    font-weight: bold;
    font-size: 1.1em;
}

.add-to-cart-btn {
    background-color: #007BFF;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
}

.add-to-cart-btn:hover {
    background-color: #0056b3;
}

.cart-badge {
    position: fixed;
    right: 20px;
    bottom: 80px;
    background-color: #007BFF;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
